<form autocomplete="off" class="layui-form layui-box modal-form-box" action="{:request()->url()}" data-auto="true"  method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">套餐名称</label>
        <div class="layui-input-block">
            {if $vo and isset($vo.title)}
            <input name="titles" value='{$vo.titles|default=""}'  title="请输入套餐名称" placeholder="请输入套餐名称" class="layui-input">
            {else}
            <input name="titles" value='{$vo.titles|default=""}'  pattern="^.{2,}$" title="请输入套餐名称" placeholder="请输入2位及以上套餐名称" class="layui-input">
            {/if}
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">套餐描述</label>
        <div class="layui-input-block">
            <input type="text" autofocus name="desc" value='{$vo.desc|default=""}' pattern="^.{4,}$" title="请输入套餐描述" placeholder="请输入4位及以上套餐描述" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">套餐价格</label>
        <div class="layui-input-block">
            <input type="text" autofocus name="script" value='{$vo.script|default=""}' pattern="^[0-9]{1,}$" title="请输入套餐价格" placeholder="请输入套餐价格 只能是数值" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">套餐内容</label>
        <div class="layui-input-block">
            <textarea name="content">{$vo.content|default=''|htmlspecialchars_decode}</textarea>
        </div>
    </div>


    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($vo['id'])}<input type='hidden' value='{$vo.id}' name='id'>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>
    </div>
    <script>
        require(['jquery', 'ckeditor', 'angular'], function () {
            window.form.render();
            window.createEditor('[name="content"]', {height: 200});
        });

    </script>
</form>
